package com.example.flashsales.entity.vo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * 商品视图对象 (集合goods goods_details goods_type表)
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GoodsVo {

    //商品id
    private long id;
    //商品编号
    private long productNumber;
    //商品名称
    private String name;
    //商品价格
    private double price;
    //商品类别id
    private Integer typeId;
    //商品类别
    private String type;
    //商品数量
    private double count;
    //商品的图片地址
    private String url;
    //商品细节id
    private long detailsId;
    //商品细节
    private String details;
    //总销量
    private long allCount;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        GoodsVo goodsVo = (GoodsVo) o;
        return id == goodsVo.id;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, productNumber, name, price, typeId, type, count, url, detailsId, details, allCount);
    }
}
